def get_access_ipaddress(request):
    """获取用户访问ip地址"""
    if request.META.get('HTTP_X_FORWARDED_FOR'):
        access_ip = request.META['HTTP_X_FORWARDED_FOR']
    else:
        access_ip = request.META['REMOTE_ADDR']
    return access_ip